clear all
set more off 
cd "/media/data/mast/zillow/data/qje_data_archive"

********************************************************************************
* in-migration to areas near new buildings (figure 1)

********************************************************************************

use in_mig_summary_file,clear

* panel A--above median income origin

local type rich

binscatter an_`type'_gross_migrants an_`type'_close_migrants an_`type'_building_migrants move_year  ///
	, line(connect) ///
	legend(label(1 "Total within 250m") label(2 "Non-building within 250m") ///7
	label(3 "Building migrants"))  ///
	xscale(range(2011 2017) ) xtick(2011(1)2017)  xlabel(2011(2)2017) ///
	yscale(range(0 50) ) ytick(0(10)50)  ylabel(0(10)50) ///		
	ytitle("Arrivals") xtitle("Year") ///
	xline(2014.5, lwidth(20) lc(gs15)) ///
	colors(black blue red) ///
	msymbols(X Sh Th) 

* panel B--below 2/3 median income origin

local type vpoor

binscatter an_`type'_gross_migrants an_`type'_close_migrants an_`type'_building_migrants move_year  ///
	, line(connect) ///
	legend(label(1 "Total within 250m") label(2 "Non-building within 250m") ///7
	label(3 "Building migrants"))  ///
	xscale(range(2011 2017) ) xtick(2011(1)2017)  xlabel(2011(2)2017) ///
	yscale(range(0 50) ) ytick(0(10)50)  ylabel(0(10)50) ///		
	ytitle("Arrivals") xtitle("Year") ///
	xline(2014.5, lwidth(20) lc(gs15)) ///
	colors(black blue red) ///
	msymbols(X Sh Th) 


